watsonx Assistant Setup

Details regarding the technical solution on how we configured Watsons Assistant to enable Core capabilities.

Pre-Requisites

Note

Before going on to the following steps, please make sure you have the following instances available: * watsonx Assistant Instance * Watson Discovery Instance * watsonx.ai Instance

Create watsonx Assistant

If you do not have an watsonx Assistant, create new bot and fill in all required information. Please see Details section below.

  1. Fill in Assistant name (for example “AskFinance Assistant”), and click “Next”.
  2. You’d see the following view. Fill in the form and click “Next”.
  3. Fill in a name for you assistant. For example, enter “AskFinance Assistant”. Click “Next”
  4. You’d see the following view. Click “Create” to complete creation of your watsonx Assistant.

Build Custom Extensions

To enable AI conversations with financial data, we’d need to configure the Watson Discovery custom extension to access to data corpus and configure the watsonx.ai custom extension to leverage LLM capabilties.

Create Watson Discovery Custom Extension

  1. Once created, in your assistant, navigate to “Integrations” page.
  2. Click “Build custom extensions” -> click “Next” -> Input Extension name Watson Discovery -> click “Next”
  3. Download the Watson Discovery OpenAPI json file: watson-discovery-query-openapi.json and import file to WA. This file contains the configuration to enable accessing to watson discovery from watsonx assistant.
  4. click “Next” -> click “Finish”
  5. Lower Right corner of the Watson Disovery extension, click “Add” -> click “Add” -> click “Next”
  6. In Authentication page, in the Authentication type dropdown, select “Basic auth”
    1. For Username enter apikey
    2. For password and discovery_url, within IBM Cloud -> resource list -> click on you Watson Discovery Instance
    3. You’d see the following view.
      1. Copy API Key and paste it in Password field.
      2. Copy URL and paste it in discovery_url and remove https:// from the beginning of the string
  7. Click “Next”, click “Finish”, click “Close”

Create watsonx.ai Custom Extension

  1. In your assistant, navigate to Integrations page, click “Build custom extension” -> click “Next” -> Input Extension name watsonx.ai -> click “Next” .
  2. download json file: watsonx-openapi.json and import file to WA
  3. click “Next” -> click “Finish”
  4. Lower Right corner of the watsonx extension, click “Add” -> click “Add” -> click “Next”
  5. In Authentication page, in the Authentication type dropdown, select “OAuth 2.0”
    1. For Apikey, create and copy a new API key from API key
    2. For Server variables, select the region that matches where your environment is configured in.
  6. Click “Next”, click “Finish”, click “Close”
  7. Your Extensions section will appear as following screenshot once both Watson Discovery and watsonx.ai custom extensions were configured.

Upload/Download actions

To reinstate a backup copy of actions that you exported from another service instance or environment, import the JSON file of the actions you exported.

Upload Actions:

  1. On the Actions page of watsonx Assistant, click on Global Settings.
  2. On the Upload/Download tab, click the Upload button and upload an actions.json file.

Configuration after uploading Actions

  • Example: Configure the “Invoke watsonx generation API” action
    1. On Step 1, click “Edit extension” to setup watsonx.ai custom extension.
    2. For the Extension options, select “watsonx.ai” and for the Operation options, select “Generation”
    3. For “Parameters”, configure the following to pass the these variables to the watsonx.ai custom extension properly.
      1. set version to watsonx_api_version variable
      2. set input to model_input variable
      3. set model_id to model_id variable
      4. set project_id to watsonx_project_id variable
    4. Click “Apply”, and click “Save”.

Download Actions

  1. To download: On the Upload/Download tab, click on the “Download” button to export action.json file.

Modify AI Assistant

Conversation Starters

  1. Navigate to the “Preview” tab. Click the blue “Customize web chat” button.
  2. Navigate to the “Home screen” tab. Modify the Greeting messages and Conversation Starters to match frequently asked questions.

Advanced watsonx Assistant Configuration

Autocorrection

  • To tackle typos, we leveraged watsonx assistant capability of Autocorrection.
  • To enable this feature, navitate to Actions -> All items -> Created by you. Click “Global Settings” on the upper right corner.
  • Navigate to the Autocorrection tab and make sure the toggle is switched to on.